<!doctype html>
<html lang="en">
<head>
    @include('web.layout.head')
    <link rel="stylesheet" href="{{asset('/control/city_linkage/css/city-picker.css')}}"/>
    <link rel="stylesheet" href="{{asset('/css/web/user/pw_revise.css')}}">
</head>
<body>
@include('web.layout.header')
@include('web.layout.user_tab')
<div class="base_member_content">
    <div class="w1200">
        @include('web.layout.member_nav')
        <div class="nav_right flr">
            <div class="base_content">
                <div class="line_title">邮箱修改</div>
                <div class="revise_subnav">
                    <ul>
                        <li class="cur">修改邮箱</li>
                        <li >验证邮箱</li>
                        <li >完成</li>
                    </ul>
                </div>
                <div class="revise_content">
                    <div class="box">
                        <form action="{{URL('member/user/email_revisetw')}}" id="email_revise" method="post" onsubmit="return frm_data_check();">
                            <div class="yz">已验邮箱： &nbsp; {{$email}}</div>
                            <ul>
                                <li>
                                    <span>新邮箱：</span>
                                    <input name='email' id='email' value="{{ old('email') }}" type="text" class="yzm getborder" autocomplete="off" style="width:256px;"/>
                                    <p class="jm_error">
                                        @if($message)
                                            {{$message}}
                                        @endif
                                    </p>
                                </li>
                                <li>
                                    <span>验证码：</span>
                                    <input name='captcha' id='captcha' type="text" class="yzm getborder" autocomplete="off">
                                    <p class="jm_error">
                                        @if($errors->has('captcha'))
                                            {{$errors->first('captcha')}}
                                        @endif
                                    </p>
                                    <img src="{{captcha_src('flat')}}" onclick="this.src='/captcha/flat?'+Math.random()" alt="验证码" title="刷新图片" width="100" height="33" id="verify" border="0" />
                                    <a href="javascript:;" onclick="document.getElementById('verify').src='{{asset('captcha/flat?')}}'+Math.random()" class="again">看不清？换一张</a>
                                </li>
                                <input type="hidden" name="_token" value="{{csrf_token()}}" />
                                <input type="hidden" name="old_email" value="{{$email}}" />
                            </ul>
                            <input type="submit" class="jm_btn6 submit" value="下一步">
                        </form>
                    </div>
                    <div class="j-err" style="margin-left:312px; margin-top: 32px; color: red; font-size: large;"></div>
                </div>
                <div class="tips">
                    <h3>为什么要进行身份验证？</h3>
                    <div class="p">1. 为保障您的账户信息安全，在变更账户中的重要信息时需要进行身份验证，感谢您的理解和支持。<br>2. 验证身份遇到问题？请拨打客服电话400-016-6889。</div>
                </div>
            </div>
        </div>
    </div>
</div>
@include('web.layout.footer')
</body>
<script>

    function frm_data_check() {
        var _frm = $('#email_revise'),
                _captcha = _frm.find('input[name="captcha"]'),
                _email = _frm.find('input[name="email"]');

        if (_captcha.val() == ''){
            _captcha.parent().find('.jm_error').html('图形验证码 必须填写');
            return false;
        }
        if (_email.val() == ''){
            _email.parent().find('.jm_error').html('邮箱 必须填写');
            return false;
        }
        var reg = /^([a-zA-Z0-9_-])+@([a-zA-Z0-9_-])+(.[a-zA-Z0-9_-])+/;
        if (!reg.test(_email.val())){
            _email.parent().find('.jm_error').html('输入的不是合法的邮箱地址 请确认');
            return false;
        }
    }
</script>
</html>